import time

import asyncio
import datetime

async def longtime():
    time.sleep(2)
    print('longtime')
    return 'abc'


async def run():
    await longtime()


def ddd():
    abc = {"bchusd": 32, "btcusd": 33}
    for i in ['bchusd', 'eos', 'btcusd']:
        if i in abc.keys():
            print(True)
            pass
        else:
            print(False)
        print(i)


def time_gap_from_today(timeStr):
    timeStruct = time.strptime("20" + timeStr, "%Y%m%d")

    timeStamp = int(time.mktime(timeStruct))
    print(timeStamp)
    today = int(time.mktime(time.localtime(time.localtime())))
    print("today",today)
    gap = (timeStamp - today) / 60 / 60 / 24 + 1
    return gap


if __name__ == "__main__":
    day1 = datetime.datetime.strptime("20190607", '%Y%m%d')
    day2 = datetime.datetime.strptime("20190608", '%Y%m%d')
    print((day1-day2).days)
    print(str(day2))
    print(str(day1))
